home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1899 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: getchar() problems!
  5. Date: Wed, 17 Jan 96 17:26:38 GMT
  6. Organization: none
  7. Message-ID: <821899598snz@genesis.demon.co.uk>
  8. References: <DL2wFD.8BK@cdf.toronto.edu> <4dgp50$6bg@comet.connix.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <4dgp50$6bg@comet.connix.com>
  15.            shawley@connix.com "Scott Hawley" writes:
  16.  
  17. >That is exactly how getchar is suppose to work. getchar will not actually
  18. >start working until a <ENTER> key is pressed.
  19.  
  20. This is how getchar() can work but there's no requirement that it work
  21. like this. getchar() will return a character if there is one available,
  22. it is up to the implementation/environment to decide when a character is
  23. available. Where the environment implements line editing it is natural to
  24. wait until a complete line is submitted i.e. until <ENTER> (or whatever)
  25. is pressed.
  26.  
  27. >If you are on a unix system you probally won't be able to get a single
  28. >character at a time with the compilier you have unless you use curses.
  29.  
  30. This can be done with Curses but it carries a lot of baggage if you're
  31. not interested in any of the other Curses features. The normal way to
  32. approach this is to turn off line editing in the TTY (see man termio or
  33. man termios). This configuration still conforms to the C language standard.
  34.  
  35. -- 
  36. -----------------------------------------
  37. Lawrence Kirby | fred@genesis.demon.co.uk
  38. Wilts, England | 70734.126@compuserve.com
  39. -----------------------------------------
  40.